
import { getInfo } from "@/api/api"
import { getBannerList, getList } from "@/api/banner"
export default {
    namespaced: true,
    state: () => ({
        list: ["123123"],
        data: [],
        user: {}
    }),
    mutations: {
        cahangeList(state, list) {
            state.list = list
        },
        cahangeData(state, list) {
            state.data = list
        }
        , cahangeInfo(state, info) {
            state.user = info
        }
    },
    actions: {
        async getList({ commit, state }) {
            let data = await getBannerList()
            console.log(data.data);
            commit("cahangeList", data.data)
        },
        async getData({ commit, state }) {
            let data = await getList({ pageid: 1, limit: 5 })
            commit("cahangeData", data.data.data)
        },
        async getInfoData({ commit, state }) {
            let data = await getInfo()
            debugger
            commit("cahangeInfo", data.data)
        }
    }
}